﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucTKB.ascx.cs" Inherits="STT.Admin.UserControls.ucTKB" %>


<%--<div id="content-header">
    <div id="breadcrumb">
        <a href="../Default.aspx" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chủ
        </a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý khóa-lớp học</a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý TKB</a>
    </div>
</div>--%>

<div class="widget-box collapsible">
    <div class="widget-title">
        <a href="#collapseOne" data-toggle="collapse" class="">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Chọn thời khóa biểu</h5>
        </a>
    </div>

                <div id="collapseOne0" class="in collapse" style="height: auto;">
                    <div class="widget-content nopadding">


                        <div class="dataTables_wrapper" role="grid">
                             <%--Cac dieu kien tim kiem --%>
                           <div class="container-fluid">
                                <div class="row-fluid">
                                    <div class="span6">
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn khóa học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="ddlKhoaHoc" runat="server" class="span20" AutoPostBack="true"
                                                    OnSelectedIndexChanged="ddlKhoaHoc_SelectedIndexChanged">
                                                </asp:DropDownList>
                                           
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span6">
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn lớp học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="ddlLop" runat="server" class="span20" OnSelectedIndexChanged="ddlLop_SelectedIndexChanged"
                                                     AutoPostBack="true">
                                                </asp:DropDownList>

                                            </div>
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
    </div>   

<div class="widget-box collapsible">
    <div class="widget-title">
        <a href="#collapseOne" data-toggle="collapse" class="">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Tạo thời khóa biểu</h5>
        </a>
    </div>

                <div id="Div1" class="in collapse" style="height: auto;">
                    <div class="widget-content nopadding">


                        <div class="dataTables_wrapper" role="grid">
                            <%-- Cac dieu kien tim kiem --%>
                            <div class="container-fluid">
                                <div class="row-fluid">
                                    <div class="span6">
                                        <%--<div class="control-group">
                                            <label class="control-label">
                                                Chọn khóa học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="DropDownList1" runat="server" class="span20"
                                                    OnSelectedIndexChanged="ddKhoaHoc_SelectedIndexChanged">
                                                </asp:DropDownList>                                         
                                            </div>
                                        </div>--%>
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn ngày học:</label>
                                            <div class="controls">
                                                <asp:TextBox ID="txtNgayHoc" runat="server" CssClass="validate span20"
                                                    data-validate="required" TextMode="Date"
                                                    OnTextChanged="txtNgayHoc_TextChanged" AutoPostBack="true"></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn giáo viên:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="ddlGiangVien" runat="server" CssClass="span20 validate" data-validate="required"
                                                    Enabled="False">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn phòng học:
                                            </label>
                                            <div class="controls">

                                                <asp:DropDownList ID="ddlPhongHoc" runat="server" CssClass="span20 validate" Enabled="False"
                                                    data-validate="required" >
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span6">
                                        <%--<div class="control-group">
                                            <label class="control-label">
                                                Chọn lớp học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="DropDownList2" runat="server" class="span20" OnSelectedIndexChanged="ddlLop_SelectedIndexChanged"
                                                     AutoPostBack="true">
                                                </asp:DropDownList>

                                            </div>
                                        </div>--%>
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn ca học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="ddlCaHoc" runat="server" CssClass="validate span20" Enabled="False"
                                                    data-validate="required">
                                                </asp:DropDownList>
                                              
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">
                                                Chọn môn học:
                                            </label>
                                            <div class="controls">
                                                <asp:DropDownList ID="ddlMonHoc" runat="server" CssClass="span20 validate" Enabled="false"
                                                    data-validate="required">
                                                </asp:DropDownList>
                                            </div>
                                        </div>

                                    </div>
                                </div>

                                <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
                                    <asp:Button ID="btThemMoiTKB" runat="server" CssClass="btn btn-primary btValidate" Text="Thêm mới"
                                        OnClick="btThemMoiTKB_Click" Enabled="false" />
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
   
<%-- Gridview thời khóa biểu --%>
<div class="widget-box">
    <div class="widget-title">
        <a href="#collapseTwo" data-toggle="collapse" class="">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Thới khóa biểu</h5>
        </a>
    </div>
    <%--<div class="in collapse" id="collapseTwo" style="height: 600px">--%>
        <div class="widget-content nopadding">
            <div id="Div2" class="dataTables_wrapper" role="grid">
                <asp:GridView ID="gvTKBtam" runat="server" CssClass="table table-bordered table-hover"
                    AutoGenerateColumns="False" DataKeyNames="MaTKB"
                    OnRowCommand="gvTKBtam_RowCommand"
                    ShowHeaderWhenEmpty="True" OnRowDeleting="gvTKBtam_RowDeleting"
                    OnPageIndexChanging="gvTKBtam_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:CheckBox ID="cbChonTat" runat="server" onclick="cbChonTat(this);" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbChon" runat="server" onclick="cbChon(this);" />
                            </ItemTemplate>
                            <ItemStyle Width="10px" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:BoundField DataField="TenMonHoc" HeaderText="Tên môn học"
                            SortExpression="TenMonHoc" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="TenGV" HeaderText="Tên giảng viên"
                            SortExpression="TenGV" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="NgayHoc" HeaderText="Ngày học"
                            SortExpression="NgayHoc" ItemStyle-CssClass="span2" DataFormatString="{0:dd-MM-yyyy}">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="TenCa" HeaderText="Ca Học"
                            SortExpression="TenCa" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="TenPH" HeaderText="Phòng Học" SortExpression="TenPH" />
                        <asp:BoundField DataField="TenLop" HeaderText="Tên Lớp" SortExpression="TenLop" />
                        <%--<asp:TemplateField HeaderText="Sửa" ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                    Text="Sửa" CommandName="ChonSua" CommandArgument="<%#((GridViewRow)Container).RowIndex%>">
                                <img src="../../img/edit.jpg" alt="Alternate Text" />
                                </asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                            <ItemTemplate>
                                <%-- Bắt sự kiện nhấn nút xóa --%>
                                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa?');">
                                <img src="../../img/delete.jpg" alt="Alternate Text" />
                                </asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <label>
                            Chưa có dữ liệu
                        </label>
                    </EmptyDataTemplate>
                </asp:GridView>

                <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
                    <asp:LinkButton ID="LinkButton3" runat="server" CssClass="btn" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa các dòng đã chọn?');"
                        OnClick="LinkButton3_Click">Xóa chọn</asp:LinkButton>

                    <div class="btn-group">

                        <asp:LinkButton ID="LinkButton4" runat="server" CssClass="btn" PostBackUrl="~/Admin/Default.aspx?idpage=14">Thêm từ file Excel</asp:LinkButton>

                    </div>

                    <asp:Button ID="btnLuu" runat="server" Text="Lưu" class="btn btn-info" OnClick="btnLuu_Click1" />
                </div>
            </div>
        </div>
     </div>
<%--</div>--%>

<div class="widget-box">
    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5>Danh sách thời khóa biểu</h5>

        <%--<div id="search">
            <asp:TextBox ID="txtTimKiem" runat="server" placeholder="Nhập từ tìm kiếm..."></asp:TextBox>
            <button class="tip-left" data-original-title="Tìm kiếm">
                <asp:ImageButton ID="btSearch" runat="server" ImageUrl="~/img/icon-search.png" OnClick="btSearch_Click" />
            </button>
        </div>--%>
    </div>

    <div class="widget-content nopadding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
            <asp:GridView ID="gvTKB" runat="server" CssClass="table table-bordered table-hover"
                AutoGenerateColumns="False" DataKeyNames="MaTKB"
                OnRowCommand="gvTKB_RowCommand"
                ShowHeaderWhenEmpty="True" OnRowDeleting="gvTKB_RowDeleting">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbChonTat" runat="server" onclick="cbChonTat(this);" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbChon" runat="server" onclick="cbChon(this);" />
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:BoundField DataField="MaTKB" HeaderText="Mã thời khóa biểu"
                        InsertVisible="False" ReadOnly="True" SortExpression="MaTKB"
                        ItemStyle-CssClass="span1" Visible="false">
                        <ItemStyle CssClass="span1"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenMonHoc" HeaderText="Tên môn học"
                        SortExpression="TenPB" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenGV" HeaderText="Tên giảng viên"
                        SortExpression="TenGV" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="NgayHoc" HeaderText="Ngày học" DataFormatString="{0:dd-MM-yyyy}">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenCa" HeaderText="Ca học"
                        SortExpression="TenCa" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenPH" HeaderText="Phòng học"
                        SortExpression="TenPH" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenLop" HeaderText="Tên lớp " />
                   <%-- <asp:TemplateField HeaderText="Sửa" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                Text="Sửa" CommandName="ChonSua" CommandArgument="<%#((GridViewRow)Container).RowIndex%>">
                                <img src="../../img/edit.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                        <ItemTemplate>
                            <%-- Bắt sự kiện nhấn nút xóa --%>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa?');">
                                <img src="../../img/delete.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <label>
                        Chưa có dữ liệu
                    </label>
                </EmptyDataTemplate>
            </asp:GridView>

            <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">

                <asp:LinkButton ID="lbXoaTat" runat="server" CssClass="btn" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa các dòng đã chọn?');"
                    OnClick="lbXoaTat_Click">Xóa chọn</asp:LinkButton>

               <%-- <div class="btn-group">
                    <asp:LinkButton ID="ltThemMoi" runat="server" CssClass="btn" PostBackUrl="~/Admin/Default.aspx?idpage=ttkb" >Thêm mới</asp:LinkButton>
                </div>--%>

                <asp:HyperLink ID="HyperLink2" CssClass="btn" Target="_blank" runat="server" NavigateUrl="~/Report/ViewTKBieu.aspx">                        
                            Xuất dữ liệu
                </asp:HyperLink>

            </div>
        </div>
    </div>
</div>

<%--<script>

    $(document).ready(function () {

    });
</script>--%>


